<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class forgot_model extends CI_Model {

	public function check_mail($mem_mail)
	{
		$this->db->select('mem_mail,mem_name,mem_id,mem_fname,mem_lname,mem_dateregister');		
		$this->db->from('member');
		$this->db->where('mem_mail' ,$mem_mail);
		$this->db->limit(1);
		$query = $this->db->get();

		if($query -> num_rows() == 1){
    		return $query->result_array();

  		}else{
    		return 0;
 		}
	}

	public function otp($input)
	{
		$this->db->where('mem_id' ,$input['mem_id']);
		$this->db->update('member' ,$input);
	}

	public function get_member($id)
	{
		$this->db->select('mem_dateregister,otp,otp_exp,mem_name');		
		$this->db->from('member');
		$this->db->where('mem_id' ,$id);
		$this->db->limit(1);
		$query = $this->db->get();
		return $query->result_array();
	}

}